00001 /////////////////////////////////////////////////////////////////////////////// 00002 /// @file deOGG.hpp 00003 /// 00004 /// @brief Destiny Sound System OGG Bit Stream 00005 /// 00006 /// @author paradoxnj 00007 /// 00008 /// This file is the intellectual property of Novus Delta, LLC.. Usage of the 00009 /// contents of this file is subject to the Destiny3D Member License which 00010 /// can be found at http://www.destiny3d.com. Any other usage is prohibited. 00011 /// 00012 /// This file is distributed "AS IS" without warranty of any kind. Novus 00013 /// Delta, LLC. does not guarantee the fitness of the contents of this file 00014 /// for any particular purpose. 00015 /// 00016 /// Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved. 00017 /// 00018 /// <hr> 00019 /// Change History 00020 /// <hr> 00021 /// 00022 /// @date Jan 2002 00023 /// @author paradoxnj 00024 /// @remarks Creation 00025 /// 00026 /////////////////////////////////////////////////////////////////////////////// 00027 00028 #ifndef DEOGG_HPP 00029 #define DEOGG_HPP 00030 00031 //Destiny Includes 00032 #include "deSound_priv.hpp" 00033 00034 //Vorbis SDK Includes 00035 #include "ogg/ogg.h" 00036 #include "vorbis/codec.h" 00037 00038 //Forward Class Declaration 00039 class deOGG; 00040 class IdeFile; 00041 class IdeFSReal; 00042 00043 //Class Declaration 00044 class deOGG : public deSoundData 00045 { 00046 public: 00047 deOGG(); 00048 deOGG(char *filename); 00049 virtual ~deOGG(); 00050 00051 private: 00052 WAVEFORMATEX m_Format; //Buffer format from OGG Bit Stream 00053 IdeFile *m_pSource; //The file to stream from 00054 IdeFSReal *m_pSourceSystem; //The file system to stream from 00055 00056 ogg_sync_state m_oy; //Sync and verify incoming bitstream 00057 ogg_stream_state m_os; //Take physical pages and weld into a logical stream of packets 00058 ogg_page m_og; //One OGG Bitstream page. Vorbis packets are inside 00059 ogg_packet m_op; //One raw packet of data for decode 00060 00061 vorbis_info m_vi; //Struct for all the static Vorbis bitstream settings 00062 vorbis_comment m_vc; //Struct for all the bitstream user comments 00063 vorbis_dsp_state m_vs; //Central working state for the packet->PCM decoder 00064 vorbis_block m_vb; //Local working space for the packet->PCM decoder 00065 00066 DWORD m_BufferSize; //The size of the buffer 00067 DWORD m_CurrWritePos; //The current write position of the buffer; 00068 DWORD m_FillLength; //The length of the data that fills the buffer 00069 DWORD m_FillPos; //The position to copy data to in the buffer 00070 DWORD m_SecureDistance; //A safe distance for the next data stream packet 00071 DWORD m_EmptyPos; //The end of the data stream 00072 00073 int m_InterfaceType; 00074 int m_RefCount; 00075 00076 public: 00077 void *GetInterface(int interface_id); 00078 00079 deBoolean Initialize(const char *filename); 00080 void Destroy(); 00081 00082 int GetDataChunk(void *ptr, long size, s32 DataOffset); 00083 uint8 *GetAllData(); 00084 00085 deBoolean AtEndOfStream(); 00086 void SetPosition(long NewPos); 00087 00088 void GetFormat(WAVEFORMATEX *format); 00089 u32 GetLength(); 00090 00091 IdeResourceBase *MakeCopy(); 00092 00093 int GetType() { return m_InterfaceType; } 00094 }; 00095 00096 #endif
1.3-rc3